package com.datang.springcode.beanextends2;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Beanextends2Config {

    @Bean
    public Lovers lovers(){
        return  new Lovers();
    }


    @Bean
    public Woman woman(){
        return new Woman();
    }

    @Bean
    public Marriage marriage(){
        Marriage marriage = new Marriage();
        marriage.setWoman(woman());
        return marriage;
    }
}
